Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadXmlHttpPanel=function(a){Telerik.Web.UI.RadXmlHttpPanel.initializeBase(this,[a]);
this._uniqueId="";
this._isCallbackPanel=false;
this._loadingPanelID="";
this._enableClientScriptEvaluation=false;
};
Telerik.Web.UI.RadXmlHttpPanel.prototype={initialize:function(){Telerik.Web.UI.RadXmlHttpPanel.callBaseMethod(this,"initialize");
this._loaded=true;
if(!this._isCallbackPanel&&this.get_value()){this.set_value(this.get_value());
}},get_webMethodName:function(){return this._webMethodName;
},set_webMethodName:function(a){this._webMethodName=a;
},get_webMethodPath:function(){return this._webMethodPath;
},set_webMethodPath:function(a){this._webMethodPath=a;
},get_value:function(){return this._value;
},set_value:function(a){this._value=a;
if(!this._loaded){return;
}window.setTimeout(Function.createDelegate(this,function(){this._showLoadingPanel();
if(this._isCallbackPanel){this._execCallback();
}else{var b=this._getWebServiceLoader();
b.loadData({context:this._getWebServiceArgument()});
}}),10);
},reload:function(){this.set_value(this.get_value());
},_raiseResponseEnded:function(){this.raiseEvent("responseEnded",new Sys.EventArgs());
},set_html:function(a){this._hideLoadingPanel();
var c=new Telerik.Web.UI.RadXmlHttpPanelEventArgs(a);
this.raiseEvent("responseEnding",c);
if(c.get_cancel()){return;
}a=c.get_content();
if(null==a){a="";
}var d=this.get_element();
this._disposeElement(d,true);
d.innerHTML=a;
if(this.get_enableClientScriptEvaluation()){var b=Function.createDelegate(this,this._raiseResponseEnded);
$telerik.evalScripts(d,b);
}else{this._raiseResponseEnded();
}},_disposeElement:function(c,d){if(!c){return;
}if(c.nodeType===1){var a=c.getElementsByTagName("*");
for(var b=a.length-1;
b>=0;
b--){this._disposeElementInternal(a[b]);
}if(!d){this._disposeElementInternal(c);
}}},_disposeElementInternal:function(e){var a=e.dispose;
if(a&&typeof(a)==="function"){e.dispose();
}else{var b=e.control;
if(b&&typeof(b.dispose)==="function"){b.dispose();
}}},_hideLoadingPanel:function(){var a=this._getLoadingPanel();
if(a&&a.hide){a.hide(this.get_element().id);
}},_showLoadingPanel:function(){var a=this._getLoadingPanel();
if(a&&a.show){a.show(this.get_element().id);
}},_getLoadingPanel:function(){return $find(this.get_loadingPanelID());
},_getWebServiceArgument:function(){var a={Value:this._value};
return a;
},_getCallbackArgument:function(){var a=String.format('{{ Value : "{0}"}}',this.get_value());
return a;
},_onError:function(b){if(!b){b="No error data available";
}this._hideLoadingPanel();
var a=new Telerik.Web.UI.RadXmlHttpPanelErrorEventArgs(b);
this.raiseEvent("responseError",a);
if(!a.get_cancelErrorAlert()){alert("XmlHttpPanel Callback Loading error:\n Exception="+b);
}},_onCallbackResponse:function(b,a){this.set_html(b);
},_onCallbackError:function(b,a){this._onError(b);
},_execCallback:function(){var b=Function.createDelegate(this,this._onCallbackResponse);
var c=Function.createDelegate(this,this._onCallbackError);
var a=this._getCallbackArgument();
WebForm_DoCallback(this._uniqueId,a,b,"SOME_CONTEXT",c,true);
},_getWebServiceLoader:function(){if(!this._webServiceLoader){var a=new Telerik.Web.UI.WebServiceSettings({path:this.get_webMethodPath(),method:this.get_webMethodName()});
this._webServiceLoader=new Telerik.Web.UI.WebServiceLoader(a);
this._webServiceLoader.add_loadingError(Function.createDelegate(this,this._onWebServiceError));
this._webServiceLoader.add_loadingSuccess(Function.createDelegate(this,this._onWebServiceResponse));
}return this._webServiceLoader;
},_onWebServiceError:function(a,b){this._onError(b.get_message());
},_onWebServiceResponse:function(a,b){var c=b.get_data();
this.set_html(c);
},add_responseEnd:function(a){this.get_events().addHandler("responseEnding",a);
},remove_responseEnd:function(a){this.get_events().removeHandler("responseEnding",a);
},add_responseEnding:function(a){this.get_events().addHandler("responseEnding",a);
},remove_responseEnding:function(a){this.get_events().removeHandler("responseEnding",a);
},add_responseEnded:function(a){this.get_events().addHandler("responseEnded",a);
},remove_responseEnded:function(a){this.get_events().removeHandler("responseEnded",a);
},add_responseError:function(a){this.get_events().addHandler("responseError",a);
},remove_responseError:function(a){this.get_events().removeHandler("responseError",a);
},get_enableClientScriptEvaluation:function(){return this._enableClientScriptEvaluation;
},set_enableClientScriptEvaluation:function(a){this._enableClientScriptEvaluation=a;
},get_loadingPanelID:function(){return this._loadingPanelID;
},set_loadingPanelID:function(a){if(this._loadingPanelID!=a){this._loadingPanelID=a;
}}};
Telerik.Web.UI.RadXmlHttpPanel.registerClass("Telerik.Web.UI.RadXmlHttpPanel",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.RadXmlHttpPanelEventArgs=function(a){Telerik.Web.UI.RadXmlHttpPanelEventArgs.initializeBase(this);
this._content=a;
};
Telerik.Web.UI.RadXmlHttpPanelEventArgs.prototype={get_content:function(){return this._content;
},set_content:function(a){this._content=a;
}};
Telerik.Web.UI.RadXmlHttpPanelEventArgs.registerClass("Telerik.Web.UI.RadXmlHttpPanelEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadXmlHttpPanelErrorEventArgs=function(a){Telerik.Web.UI.RadXmlHttpPanelErrorEventArgs.initializeBase(this);
this._cancelErrorAlert=false;
this._errorMessage=a;
};
Telerik.Web.UI.RadXmlHttpPanelErrorEventArgs.prototype={get_errorMessage:function(){return this._errorMessage;
},get_cancelErrorAlert:function(){return this._cancelErrorAlert;
},set_cancelErrorAlert:function(a){this._cancelErrorAlert=a;
}};
Telerik.Web.UI.RadXmlHttpPanelErrorEventArgs.registerClass("Telerik.Web.UI.RadXmlHttpPanelErrorEventArgs",Sys.EventArgs);
